inherited fmClAgreeEdit: TfmClAgreeEdit
  Caption = #1050#1086#1088#1088#1077#1082#1094#1080#1103' '#1076#1086#1075#1086#1074#1086#1088#1072
  ClientHeight = 214
  ClientWidth = 265
  OnShow = FormShow
  ExplicitWidth = 273
  ExplicitHeight = 248
  PixelsPerInch = 96
  TextHeight = 13
  object Label6: TLabel [0]
    Left = 8
    Top = 8
    Width = 83
    Height = 13
    Caption = #1053#1072#1095#1072#1083#1100#1085#1072#1103' '#1076#1072#1090#1072
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clNavy
    Font.Height = -11
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
  end
  object Label7: TLabel [1]
    Left = 135
    Top = 8
    Width = 77
    Height = 13
    Caption = #1050#1086#1085#1077#1095#1085#1072#1103' '#1076#1072#1090#1072
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clNavy
    Font.Height = -11
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
  end
  object Label4: TLabel [2]
    Left = 8
    Top = 48
    Width = 69
    Height = 13
    Caption = #1058#1080#1087' '#1076#1086#1075#1086#1074#1086#1088#1072
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clNavy
    Font.Height = -11
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
  end
  object Label1: TLabel [3]
    Left = 8
    Top = 91
    Width = 64
    Height = 13
    Caption = #8470' '#1076#1086#1075#1086#1074#1086#1088#1072
    FocusControl = edCANUMBER
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clNavy
    Font.Height = -11
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
  end
  inherited sbBottom: TStatusBar
    Top = 187
    Width = 265
    ExplicitTop = 187
    ExplicitWidth = 265
  end
  inherited Panel1: TPanel
    Top = 142
    Width = 265
    ExplicitTop = 142
    ExplicitWidth = 265
  end
  object edCABEGIN: TcxDBDateEdit [6]
    Left = 8
    Top = 24
    DataBinding.DataField = 'CABEGIN'
    DataBinding.DataSource = dlgDS
    Properties.ImmediatePost = True
    Properties.SaveTime = False
    Properties.ShowTime = False
    Style.BorderStyle = ebs3D
    TabOrder = 2
    Width = 121
  end
  object edCAEND: TcxDBDateEdit [7]
    Left = 135
    Top = 24
    DataBinding.DataField = 'CAEND'
    DataBinding.DataSource = dlgDS
    Properties.ImmediatePost = True
    Properties.SaveTime = False
    Properties.ShowTime = False
    Style.BorderStyle = ebs3D
    TabOrder = 3
    Width = 121
  end
  object edCATYPE: TcxDBLookupComboBox [8]
    Left = 8
    Top = 66
    DataBinding.DataField = 'CATYPE'
    DataBinding.DataSource = dlgDS
    Properties.DropDownListStyle = lsFixedList
    Properties.ImmediatePost = True
    Properties.KeyFieldNames = 'SDID'
    Properties.ListColumns = <
      item
        FieldName = 'SDNAME'
      end>
    Properties.ListOptions.ShowHeader = False
    Properties.ListSource = dsTypes
    Style.BorderStyle = ebs3D
    Style.Shadow = False
    Style.ButtonStyle = btsDefault
    TabOrder = 4
    Width = 248
  end
  object edCANUMBER: TDBEdit [9]
    Left = 8
    Top = 107
    Width = 248
    Height = 21
    DataField = 'CANUMBER'
    DataSource = dlgDS
    TabOrder = 5
  end
  inherited dlgDS: TDataSource
    DataSet = qAgr
    Left = 64
    Top = 8
  end
  object qAgr: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    AfterInsert = qAgrAfterInsert
    BeforePost = qAgrBeforePost
    CachedUpdates = True
    SQL.Strings = (
      'SELECT *'
      '  FROM CLAGREEMENTS C'
      ' WHERE C.CAID = :CAID   ')
    UpdateObject = quAgr
    GeneratorField.Field = 'CAID'
    GeneratorField.Generator = 'GCLAGREEMENTS'
    Left = 88
    Top = 8
    ParamData = <
      item
        DataType = ftInteger
        Name = 'CAID'
        ParamType = ptUnknown
      end>
    object qAgrCAID: TIntegerField
      FieldName = 'CAID'
      Origin = '"CLAGREEMENTS"."CAID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qAgrCLID: TIntegerField
      FieldName = 'CLID'
      Origin = '"CLAGREEMENTS"."CLID"'
    end
    object qAgrCATYPE: TIntegerField
      FieldName = 'CATYPE'
      Origin = '"CLAGREEMENTS"."CATYPE"'
    end
    object qAgrCANUMBER: TIBStringField
      FieldName = 'CANUMBER'
      Origin = '"CLAGREEMENTS"."CANUMBER"'
      Size = 40
    end
    object qAgrCABEGIN: TDateField
      FieldName = 'CABEGIN'
      Origin = '"CLAGREEMENTS"."CABEGIN"'
    end
    object qAgrCAEND: TDateField
      FieldName = 'CAEND'
      Origin = '"CLAGREEMENTS"."CAEND"'
    end
  end
  object quAgr: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  CAID,'
      '  CLID,'
      '  CATYPE,'
      '  CANUMBER,'
      '  CABEGIN,'
      '  CAEND'
      'from CLAGREEMENTS '
      'where'
      '  CAID = :CAID')
    ModifySQL.Strings = (
      'update CLAGREEMENTS'
      'set'
      '  CABEGIN = :CABEGIN,'
      '  CAEND = :CAEND,'
      '  CAID = :CAID,'
      '  CANUMBER = :CANUMBER,'
      '  CATYPE = :CATYPE,'
      '  CLID = :CLID'
      'where'
      '  CAID = :OLD_CAID')
    InsertSQL.Strings = (
      'insert into CLAGREEMENTS'
      '  (CABEGIN, CAEND, CAID, CANUMBER, CATYPE, CLID)'
      'values'
      '  (:CABEGIN, :CAEND, :CAID, :CANUMBER, :CATYPE, :CLID)')
    DeleteSQL.Strings = (
      'delete from CLAGREEMENTS'
      'where'
      '  CAID = :OLD_CAID')
    Left = 112
    Top = 8
  end
  object qTypes: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      'SELECT S.SDID, S.SDNAME'
      '  FROM SYS_DIC S'
      ' WHERE S.SDPARID = 21'
      ' ORDER BY S.SDID')
    Left = 144
    Top = 80
  end
  object dsTypes: TDataSource
    DataSet = qTypes
    Left = 120
    Top = 80
  end
  object qCheckDate: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      'SELECT C1.CAID'
      '  FROM CLAGREEMENTS C1'
      ' WHERE C1.CLID = :CLID'
      '   AND C1.CATYPE = :CATYPE'
      '   AND :CABEGIN BETWEEN C1.CABEGIN AND C1.CAEND'
      'UNION'
      'SELECT C1.CAID'
      '  FROM CLAGREEMENTS C1'
      ' WHERE C1.CLID = :CLID'
      '   AND C1.CATYPE = :CATYPE'
      '   AND :CAEND BETWEEN C1.CABEGIN AND C1.CAEND')
    Left = 184
    Top = 40
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'CLID'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'CATYPE'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'CABEGIN'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'CLID'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'CATYPE'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'CAEND'
        ParamType = ptUnknown
      end>
  end
end
